package com.rc.evcharger.common.enums.yl;

/**
 * Create by Yang on 2021/10/14
 */
public enum YlStartFailEnum {
    YlStartFailEnum_0(0,"启动成功"),
    YlStartFailEnum_1(1,"CC1未连接"),
    YlStartFailEnum_2(2,"绝缘检测超时"),
    YlStartFailEnum_3(3,"绝缘检测异常"),
    YlStartFailEnum_4(4,"充电机暂停服务"),
    YlStartFailEnum_5(5,"充电机系统故障，不能充电"),
    YlStartFailEnum_6(6,"辅电不匹配"),
    YlStartFailEnum_7(7,"辅电开启失败"),
    YlStartFailEnum_9(9,"充电启动超时"),
    YlStartFailEnum_10(10,"BMS通信握手失败"),
    YlStartFailEnum_11(11,"BMS通信配置失败"),
    YlStartFailEnum_12(12,"BMS参数异常"),
    YlStartFailEnum_13(13,"桩正在充电中， 不能再启动"),
    YlStartFailEnum_14(14,"本地模式，不能启动充电"),
    YlStartFailEnum_15(15,"启动未知错误"),


    /**************************交流充电桩*************************************/
    YlStartFailEnum_100001(100001,"充电机系统故障"),
    YlStartFailEnum_100002(100002,"车辆准备就绪超时"),
    YlStartFailEnum_100003(100003,"桩正在充电中， 不能再启动"),
    YlStartFailEnum_100004(100004,"本地模式，不能启动充电"),
    YlStartFailEnum_100005(100005,"枪口号不对");

    private Integer code;

    private String msg;


    /**
     * 解析code
     *
     * @param code
     * @return
     */
    public static String getYlStartFailEnumMsg(int code) {
        Class<YlStartFailEnum> ylStartFailEnumClass = YlStartFailEnum.class;
        for (YlStartFailEnum enumConstant : ylStartFailEnumClass.getEnumConstants()) {
            if (enumConstant.getCode() == code) {
                return enumConstant.getMsg();
            }
        }
        return "未知启动失败码code:" + code;
    }

    public Integer getCode() {
        return code;
    }

    YlStartFailEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public static void main(String[] args) {
//        System.out.println(YlStartFailEnum.getYlStartFailEnumMsg("17"));

    }
}
